package com.itheima.d5_Recusion.sum;

public class SumDemo {
    public static void main(String[] args) {
        int rs = sum(5);
        System.out.println(rs);
    }
    public static int sum(int n){
        if (n==1){
            return 1;
        }
        return n+ sum(n-1);
    }
}
